//
//  KongWDoctorCollectionViewCell.m
//  LoveOfPet
//
//  Created by dllo on 15/11/20.
//  Copyright © 2015年 孔维. All rights reserved.
//

#import "KongWDoctorCollectionViewCell.h"
#define kHeight     [UIScreen mainScreen].bounds.size.height / 667
#define kWidth      [UIScreen mainScreen].bounds.size.width / 375
@implementation KongWDoctorCollectionViewCell
-(void)dealloc
{
    [_img release];
    [_nameLabel release];
    [_jobLabel release];
    [super dealloc];
}
-(instancetype) initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatSubView];
    }
    return self;
}

-(void)creatSubView
{
    self.img = [[UIImageView alloc] init];
    [self.contentView addSubview:self.img];
    [self.img release];
    
    self.nameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.nameLabel];
    [self.nameLabel release];
    
    self.jobLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.jobLabel];
    [self.jobLabel release];
}

-(void)layoutSubviews
{
    self.img.frame = CGRectMake(kWidth * 5, kHeight * 5, self.frame.size.width - kWidth * 10, self.frame.size.height - kHeight * 10);
    self.img.layer.cornerRadius = (self.frame.size.width - kWidth * 10) / 2;
    
    
    self.nameLabel.frame = CGRectMake(self.img.frame.origin.x, self.img.frame.origin.y + self.img.frame.size.height + kHeight * 3, self.img.frame.size.width, kHeight * 30);
    
    self.jobLabel.frame = CGRectMake(self.nameLabel.frame.origin.x, self.nameLabel.frame.origin.y + self.nameLabel.frame.size.height + kHeight * 3, self.nameLabel.frame.size.width, kHeight * 20);
    self.jobLabel.font = [UIFont systemFontOfSize:15];
    self.jobLabel.textColor = [UIColor grayColor];
}
@end
